﻿using Microsoft.AspNetCore.Mvc;

namespace Advanced.ProjectDemo.Controllers
{
    public class SecondController : Controller
    {
        private readonly ILogger<SecondController> _Logger;
        private readonly ILogger<SecondController> _Logger2;
        public SecondController(ILogger<SecondController> _logger,ILoggerFactory _loggerFactory)
        {
            this._Logger = _logger;

            this._Logger2 = _loggerFactory.CreateLogger<SecondController>();

            this._Logger.LogInformation($"{this.GetType().Name} 构造函数进入了，当前Loger");
            this._Logger2.LogInformation($"{this.GetType().Name} 构造函数进入了，当前Loger2");
        }
        public IActionResult Index()
        {
            this._Logger.LogInformation($"index 被执行了 构造函数进入了，当前Loger");
            this._Logger2.LogInformation($"index 被执行了 构造函数进入了，当前Loger2");


            return View();
        }
    }
}
